﻿CREATE TABLE [dbo].[Hospital] (
    [Id]          INT           IDENTITY (1, 1) NOT NULL,
    [FullName]    NVARCHAR (50) NOT NULL,
    [Code]        NVARCHAR (50) NOT NULL,
    [ShortName]   NVARCHAR (50) NULL,
    [Sort]        INT           NULL,
    [HasBranch]   BIT           DEFAULT ((0)) NOT NULL,
    [IsBranch]    BIT           DEFAULT ((0)) NOT NULL,
    [GroupName]   NVARCHAR (50) NULL,
    [RecStatus]   INT           NOT NULL,
    [RecCreateDt] DATETIME      NOT NULL,
    [RecUpdateDt] DATETIME      NULL,
    [RecDeleteDt] DATETIME      NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'主键，自增长', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Hospital', @level2type = N'COLUMN', @level2name = N'Id';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'医院全称', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Hospital', @level2type = N'COLUMN', @level2name = N'FullName';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'医院编码, 全局唯一', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Hospital', @level2type = N'COLUMN', @level2name = N'Code';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'医院简称', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Hospital', @level2type = N'COLUMN', @level2name = N'ShortName';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'显示排序', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Hospital', @level2type = N'COLUMN', @level2name = N'Sort';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'是否有分院', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Hospital', @level2type = N'COLUMN', @level2name = N'HasBranch';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'是否为分院', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Hospital', @level2type = N'COLUMN', @level2name = N'IsBranch';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'医院集团名称', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Hospital', @level2type = N'COLUMN', @level2name = N'GroupName';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'记录状态, 1：正常；2：删除', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Hospital', @level2type = N'COLUMN', @level2name = N'RecStatus';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'记录创建时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Hospital', @level2type = N'COLUMN', @level2name = N'RecCreateDt';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'记录上次修改时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Hospital', @level2type = N'COLUMN', @level2name = N'RecUpdateDt';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'记录删除时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Hospital', @level2type = N'COLUMN', @level2name = N'RecDeleteDt';

